package com.example.demo.service.impl;

import com.example.demo.entity.CourseVideo;
import com.example.demo.mapper.CourseVideoMapper;
import com.example.demo.service.CourseVideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseVideoServiceImpl implements CourseVideoService {

    @Autowired
    private CourseVideoMapper courseVideoMapper;

    @Override
    public int insertCourseVideo(CourseVideo courseVideo) {
        return courseVideoMapper.insertCourseVideo(courseVideo);
    }

    @Override
    public int deleteCourseVideoById(int id) {
        return courseVideoMapper.deleteCourseVideoById(id);
    }

    @Override
    public int updateCourseVideo(CourseVideo courseVideo) {
        return courseVideoMapper.updateCourseVideo(courseVideo);
    }

    @Override
    public CourseVideo selectCourseVideoById(int id) {
        return courseVideoMapper.selectCourseVideoById(id);
    }

    @Override
    public List<CourseVideo> selectAllCourseVideos() {
        return courseVideoMapper.selectAllCourseVideos();
    }

    @Override
    public List<CourseVideo> selectCourseVideosByCourseId(int courseId) {
        return courseVideoMapper.selectCourseVideosByCourseId(courseId);
    }
}